package ru.reaperoq.taskmanager.exceptions

import org.springframework.http.HttpStatus
import org.springframework.web.bind.annotation.ResponseStatus

sealed class TaskManagerException(
    override val message: String,
    val httpStatus: HttpStatus
) : RuntimeException() {
    @ResponseStatus(value = HttpStatus.UNAUTHORIZED)
    data class Unauthorized constructor(
        override val message: String
    ) : TaskManagerException(message = message, httpStatus = HttpStatus.UNAUTHORIZED)

    @ResponseStatus(value = HttpStatus.NOT_FOUND)
    data class NotFound(
        override val message: String
    ) : TaskManagerException(message, HttpStatus.NOT_FOUND)

    @ResponseStatus(value = HttpStatus.BAD_REQUEST)
    data class BadRequest(override val message: String) : TaskManagerException(message, HttpStatus.BAD_REQUEST)
}

